package sa.com.sure.ejtimaa.common;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class AppPreferences {
	
		public static AppPreferences Instance = new AppPreferences(AppHelper.getAppContext());
	
	     private static final String APP_SHARED_PREFS = "sa.com.sure.ejtimaa_preferences"; //  Name of the file -.xml
	     private SharedPreferences appSharedPrefs;
	     private Editor prefsEditor;

	     public AppPreferences(Context context)
	     {
	         this.appSharedPrefs = context.getSharedPreferences(APP_SHARED_PREFS, Activity.MODE_PRIVATE);
	         this.prefsEditor = appSharedPrefs.edit();
	     }

	     public String getData(String key) {
	         return appSharedPrefs.getString(key, "");
	     }

	     public void setData(String key,String value) {
	         prefsEditor.putString(key, value);
	         prefsEditor.commit();
	     }
}
